package com.bml.architect.netty.heart;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

public class HeartNettyClientHandler extends SimpleChannelInboundHandler<String> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {

        System.out.println("client recive data is："+msg);
        if(msg != null && msg.equals("idle close")){
            System.out.println("服务端关闭了此连接，客户端也关闭");
            ctx.channel().closeFuture();
        }
    }


}
